package Ringbuffer;

import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.ringbuffer.Ringbuffer;
import test.PerformanceAnalyze;

import java.util.concurrent.ExecutionException;

public class RingBufferPTest {
    static PerformanceAnalyze performanceAnalyze = new PerformanceAnalyze();

    public static void main(String[] args) throws InterruptedException, ExecutionException {
        HazelcastInstance hz = Hazelcast.newHazelcastInstance();
        Ringbuffer<Long> rb = hz.getRingbuffer("rb");

        while (true) {
            rb.add(System.nanoTime());

            performanceAnalyze.meter();
        }
    }
}
